package cn.cqie.attendance.teacher.dao;

import cn.cqie.attendance.teacher.pojo.TeacherLeave;
import cn.cqie.attendance.teacher.pojo.TeacherLeaveLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author wqh
 * @date 2021/6/21 17:13
 */
@Mapper
public interface TeacherLeaveDao {
    /**
     * 老师查看自己课程下学生的请假信息
     * @param map
     * @return List<TeacherLeave>
     */
    List<TeacherLeave> queryLeaveByTeacherId(Map<String,Object> map);

    /**
     * 查看该老师课程下的学生的请假详情
     * @param leaveId
     * @return TeacherLeave
     */
    List<TeacherLeave> queryLeaveInfoByLeaveId(@Param("leaveId")Integer leaveId);

    /**
     * 某一个请假信息的请假流程管理
     * @param leaveId
     * @return List<TeacherLeaveLog>
     */
    List<TeacherLeaveLog> queryLeaveLogInfoByLeaveLogId(@Param("leaveId")Integer leaveId);

    /**
     * 根据请假id修改请假状态（通过）
     * @param map
     * @return success/fail
     */
    int updateLeaveStatusByLeaveId(Map<String,Object> map);
    /**
     * 根据请假id修改请假状态（不通过）
     * @param map
     * @return success/fail
     */
    int updateLeaveByLeaveId(Map<String,Object> map);

    /**
     * 修改请假状态插入一条日志记录
     * @param map
     * @return success/fail
     */
    int insertIntoLeaveLog(Map<String,Object> map);

    /**
     * 根据id删除一条请假信息（可以批量删除）
     * @param leaveId
     * @return success/fail
     */
    int deleteLeaveByLeaveId(String[] leaveId);

/*    *//**
     * 根据leaveId删除一条请假日志信息（可以批量删除）
     * @param leaveId
     * @return success/fail
     */
    int deleteLeaveLogByLeaveLogId(String[] leaveId);
}
